<template>
  <div class="main-layout">
    <!-- 顶部标题栏 -->
    <header class="header">
      <div class="title">地理信息系统</div>
      <el-dropdown @command="handleThemeChange">
        <el-button type="primary">
          主题切换
          <el-icon class="el-icon--right"><arrow-down /></el-icon>
        </el-button>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item command="light">浅色主题</el-dropdown-item>
            <el-dropdown-item command="dark">深色主题</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </header>
    
    <!-- 地图容器 -->
    <div class="map-container">
      <MapView />
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { ArrowDown } from '@element-plus/icons-vue'
import MapView from '../components/MapView.vue'

const handleThemeChange = (theme) => {
  // 实现主题切换逻辑
  document.documentElement.setAttribute('data-theme', theme)
}
</script>

<style scoped>
.main-layout {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  height: 60px;
  padding: 0 20px;
  background-color: var(--el-color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.title {
  font-size: vw(20);
  font-weight: bold;
}

.map-container {
  flex: 1;
  position: relative;
}
</style> 